<?php

namespace App\Http\Controllers\OpenShop\FeishuMini;

use App\Http\Controllers\BaseController;
use App\Library\Rms\RmsShopApi;
use App\Models\OpenShop\Common\OpenShopProvinceTargetModel;
use App\Models\OpenShop\InvestmentPromotion\OpenShopOrganizationRegionMappingModel;
use App\Service\OpenShop\Feishu\OrganizationManageService;
use App\Service\OpenShop\Feishu\PermissionService;
use App\Service\OpenShop\FeishuMini\ShopService;
use App\Service\OpenShop\SiteLocation\AuthService;
use Illuminate\Http\Request;

class IndexController extends BaseController
{
    public function index(Request $request)
    {
        $timeType       = (int)$request->get('timeType', ShopService::TIME_TYPE_MONTH); // 默认月
        $userId         = getRmsUserInfoByAuth()->id;
        $dataPermission = PermissionService::dataPermission(PermissionService::URI_SIGN_ORDER);

        $lists = (new ShopService())->index($dataPermission, $userId, $timeType);

        return $this->success(['lists' => $lists]);
    }
}
